/**
 */
package gatperdut.chato.model.Chato.Item.impl;

import gatperdut.chato.model.Chato.Item.Food;
import gatperdut.chato.model.Chato.Item.ItemPackage;

import org.eclipse.emf.ecore.EClass;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Food</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link gatperdut.chato.model.Chato.Item.impl.FoodImpl#getPortion <em>Portion</em>}</li>
 *   <li>{@link gatperdut.chato.model.Chato.Item.impl.FoodImpl#getMaxPortion <em>Max Portion</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class FoodImpl extends AmountImpl implements Food {
	/**
     * The default value of the '{@link #getPortion() <em>Portion</em>}' attribute.
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @see #getPortion()
     * @generated
     * @ordered
     */
	protected static final int PORTION_EDEFAULT = 0;

	/**
     * The default value of the '{@link #getMaxPortion() <em>Max Portion</em>}' attribute.
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @see #getMaxPortion()
     * @generated
     * @ordered
     */
	protected static final int MAX_PORTION_EDEFAULT = 0;

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	protected FoodImpl() {
        super();
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	@Override
	protected EClass eStaticClass() {
        return ItemPackage.Literals.FOOD;
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	public int getPortion() {
        return (Integer)eDynamicGet(ItemPackage.FOOD__PORTION, ItemPackage.Literals.FOOD__PORTION, true, true);
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	public void setPortion(int newPortion) {
        eDynamicSet(ItemPackage.FOOD__PORTION, ItemPackage.Literals.FOOD__PORTION, newPortion);
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	public int getMaxPortion() {
        return (Integer)eDynamicGet(ItemPackage.FOOD__MAX_PORTION, ItemPackage.Literals.FOOD__MAX_PORTION, true, true);
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	public void setMaxPortion(int newMaxPortion) {
        eDynamicSet(ItemPackage.FOOD__MAX_PORTION, ItemPackage.Literals.FOOD__MAX_PORTION, newMaxPortion);
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
        switch (featureID) {
            case ItemPackage.FOOD__PORTION:
                return getPortion();
            case ItemPackage.FOOD__MAX_PORTION:
                return getMaxPortion();
        }
        return super.eGet(featureID, resolve, coreType);
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	@Override
	public void eSet(int featureID, Object newValue) {
        switch (featureID) {
            case ItemPackage.FOOD__PORTION:
                setPortion((Integer)newValue);
                return;
            case ItemPackage.FOOD__MAX_PORTION:
                setMaxPortion((Integer)newValue);
                return;
        }
        super.eSet(featureID, newValue);
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	@Override
	public void eUnset(int featureID) {
        switch (featureID) {
            case ItemPackage.FOOD__PORTION:
                setPortion(PORTION_EDEFAULT);
                return;
            case ItemPackage.FOOD__MAX_PORTION:
                setMaxPortion(MAX_PORTION_EDEFAULT);
                return;
        }
        super.eUnset(featureID);
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	@Override
	public boolean eIsSet(int featureID) {
        switch (featureID) {
            case ItemPackage.FOOD__PORTION:
                return getPortion() != PORTION_EDEFAULT;
            case ItemPackage.FOOD__MAX_PORTION:
                return getMaxPortion() != MAX_PORTION_EDEFAULT;
        }
        return super.eIsSet(featureID);
    }

} //FoodImpl
